CUBRID SQL Guide¶
This chapter describes SQL syntax such as data types, functions and operators, data retrieval or table manipulation. You can also find SQL statements used for index, trigger, partition, serial and changing user information.
The main topics covered in this chapter are as follows:
- Identifier: Describes how to write, the identifier, string allowed to be used as a name of a table, index, and column.
- Reserved words: Lists reserved words in CUBRID. To use a reserved word as an identifier, enclose the identifier by using double quotes, backticks (`), or brackets ([]).
- Comment
- Data types: Describes the data types, the format to store data.
- Tables: Describes how to create, alter, drop, and rename a table.
- Index: Describes how to create, alter, and drop an index.
- VIEW: Describes how to create, alter, drop, and rename VIEW, a virtual table.
- SERIAL: Describes how to create, alter, and drop serial numbers managed by a database.
- Operators and functions: Describes the operators and functions used for query statements.
- Data retrieval and manipulation: Describes the SELECT, INSERT, UPDATE, and DELETE statements.
- Query optimization: Describes the query optimization by using the index, hint, and the index hint syntax.
- Partitioning: Describes how to partition one table into several independent logical units.
- Trigger: Describes how to create, alter, drop, and rename a trigger that is automatically executed in response to certain events.
- Java stored functions/procedures: Describes how to create a Java method and call it in the query statement.
- Method: Describes the method, a built-in function of the CUBRID database system.
- Class inheritance: Describes how to inherit the attribute from the parent to the child table (class).
- Class conflict resolution: Describes how to resolve table (class) conflicts between attributes or methods related through inheritance.
- CUBRID system catalog: Describes the CUBRID system catalog, the internal information of the CUBRID database.
- Identifier
- Reserved Words
- Comment
- Data Types
- Table
- Index
- View
- Serial
- Database User Authorization
- Operators and Functions
- Logical Operators
- Comparison Operators
- Arithmetic Operators
- Set Arithmetic Operators
- Statement Set Operators
- Containment Operators
- BIT Functions and Operators
- String Functions and Operators
- Concatenation Operator
- ASCII
- BIN
- BIT_LENGTH
- CHAR_LENGTH, CHARACTER_LENGTH, LENGTHB, LENGTH
- CHR
- CONCAT
- CONCAT_WS
- ELT
- FIELD
- FIND_IN_SET
- FROM_BASE64
- INSERT
- INSTR
- LCASE, LOWER
- LEFT
- LOCATE
- LPAD
- LTRIM
- MID
- OCTET_LENGTH
- POSITION
- REPEAT
- REPLACE
- REVERSE
- RIGHT
- RPAD
- RTRIM
- SPACE
- STRCMP
- SUBSTR
- SUBSTRING
- SUBSTRING_INDEX
- TO_BASE64
- TRANSLATE
- TRIM
- UCASE, UPPER
- Numeric Functions
- Date/Time Functions and Operators
- ADDDATE, DATE_ADD
- ADDTIME
- ADD_MONTHS
- CURDATE, CURRENT_DATE, SYS_DATE, SYSDATE
- CURRENT_DATETIME, NOW, SYS_DATETIME, SYSDATETIME
- CURTIME, CURRENT_TIME, SYS_TIME, SYSTIME
- CURRENT_TIMESTAMP, SYS_TIMESTAMP, SYSTIMESTAMP, LOCALTIME, LOCALTIMESTAMP
- DATE
- DATEDIFF
- DATE_SUB, SUBDATE
- DAY, DAYOFMONTH
- DAYOFWEEK
- DAYOFYEAR
- EXTRACT
- FROM_DAYS
- FROM_UNIXTIME
- HOUR
- LAST_DAY
- MAKEDATE
- MAKETIME
- MINUTE
- MONTH
- MONTHS_BETWEEN
- QUARTER
- ROUND
- SEC_TO_TIME
- SECOND
- TIME
- TIME_TO_SEC
- TIMEDIFF
- TIMESTAMP
- TO_DAYS
- TRUNC
- UNIX_TIMESTAMP
- UTC_DATE
- UTC_TIME
- WEEK
- WEEKDAY
- YEAR
- LOB Functions
- Data Type Casting Functions and Operators
- Aggregate/Analytic Functions
- Overview
- Aggregate vs. Analytic
- Analytic functions which "ORDER BY" clause must be specified in OVER function
- AVG
- COUNT
- CUME_DIST
- DENSE_RANK
- FIRST_VALUE
- GROUP_CONCAT
- LAG
- LAST_VALUE
- LEAD
- MAX
- MEDIAN
- MIN
- NTH_VALUE
- NTILE
- PERCENT_RANK
- RANK
- ROW_NUMBER
- STDDEV, STDDEV_POP
- STDDEV_SAMP
- SUM
- VARIANCE, VAR_POP
- VAR_SAMP
- Click Counter Functions
- ROWNUM Functions
- Information Functions
- Encryption Function
- Comparison Expression
- Comparison Functions
- Data Manipulation
- SELECT
- Hierarchical Query
- INSERT
- UPDATE
- REPLACE
- DELETE
- MERGE
- TRUNCATE
- PREPARED STATEMENT
- SET
- DO
- SHOW
- DESC, DESCRIBE
- EXPLAIN
- SHOW TABLES
- SHOW COLUMNS
- SHOW INDEX
- SHOW COLLATION
- SHOW GRANTS
- SHOW CREATE TABLE
- SHOW CREATE VIEW
- SHOW ACCESS STATUS
- SHOW EXEC STATISTICS
- SHOW VOLUME HEADER
- SHOW LOG HEADER
- SHOW ARCHIVE LOG HEADER
- SHOW HEAP HEADER
- SHOW HEAP CAPACITY
- SHOW SLOTTED PAGE HEADER
- SHOW SLOTTED PAGE SLOTS
- SHOW INDEX HEADER
- SHOW INDEX CAPACITY
- Query Optimization
- Partitioning
- Globalization
- An Overview of Globalization
- Locale Setting
- Step 1: Selecting a Locale
- Step 2: Compiling Locale
- Step 3: Setting CUBRID to Use a Specific Locale
- Step 4: Creating a Database with the Selected Locale Setting
- Step 5 (optional): Manually Verifying the Locale File
- Step 6: Starting CUBRID-Related Processes
- Synchronization of Database Collations with System Collations
- Collation
- Charset and Collation of Column
- Charset and Collation of Tables
- Charset and Collation of String Literals
- Charset and Collation of Expressions
- Charset and Collation of System Data
- Impact of Charset Specified When Creating DB
- String literal input and output
- Contraction and Expansion of Collation
- Operations Requiring Collation and Charset
- Collation settings impacting CUBRID features
- Viewing Collation Information
- Configuration Guide for Characters
- Remark
- Guide for Adding Locales and Collations
- Transaction and Lock
- Database Transaction
- Cursor Holdability
- Database Concurrency
- Lock Protocol
- Transaction Isolation Level
- SET TRANSACTION ISOLATION LEVEL
- GET TRANSACTION ISOLATION LEVEL
- SERIALIZABLE
- REPEATABLE READ CLASS with REPEATABLE READ INSTANCES
- REPEATABLE READ CLASS with READ COMMITTED INSTANCES
- REPEATABLE READ CLASS with READ UNCOMMITTED INSTANCES
- READ COMMITTED CLASS with READ COMMITTED INSTANCES
- READ COMMITTED CLASS with READ UNCOMMITTED INSTANCES
- UPDATE INCONSISTENCY
- Combination of Unsupported Isolation Level
- How to Handle Dirty Record
- Transaction Termination and Restoration
- Trigger
- Java Stored Function/Procedure
- Method
- Class Inheritance
- System Catalog